package com.remoter.transport.socket.util;

import com.remoter.basic.configure.Option;
import com.remoter.basic.util.NetUtil;

/**
 * @author			koko
 * @date 			2017-08-08 18:42:00
 * @description 	类功能说明
 */
public class FinalTransportSocket {
	
	public static final String D_VAL_SPI_NAME = "socket";
	
	//连接超时时间3秒
	public static final Option<Integer> O_VAL_CLIENT_CONNECT_TIMEOUT = Option.create("transport.socket.client.connect_timeout",3000);
	//数据读取超时时间,默认10秒
	public static final Option<Integer> O_VAL_CLIENT_READ_TIMEOUT = Option.create("transport.socket.client.read_timeout",10000);
	//数据写超时时间,默认10秒,如果执行大文件上传,请设置写超时时间稍大些
	public static final Option<Integer> O_VAL_CLIENT_WRITE_TIMEOUT = Option.create("transport.socket.client.write_timeout",10000);
	
	//默认绑定的host地址
	public static final Option<String> O_VAL_SERVER_HOST = Option.create("transport.socket.server.host",NetUtil.getLocalAddress().getHostAddress());
	//默认绑定的port
	public static final Option<Integer> O_VAL_SERVER_PORT = Option.create("transport.socket.server.port",9001);
	
	/**
	 * 考虑到防火墙的问题,即需要固定的IP,因此预留用户设置固定ip
	 */
	public static final Option<String> O_VAL_CLIENT_HOST = Option.create("transport.socket.client.host","");
	/**
	 * 如果预留的固定port为0,则随机获取可用端口,单服务状态下可用,多服务或集群不推荐使用,端口可能使用多个
	 */
	public static final Option<Integer> O_VAL_CLIENT_PORT = Option.create("transport.socket.client.port",0);
	
}